//
//  SoundPlayTool.h
//  HuiYinMaster
//
//  Created by izhifei-Devon on 2017/5/23.
//  Copyright © 2017年 Rowling. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "VoiceListModel.h"

//使用时需要给dataArray  currentId 进行赋值
@interface SoundPlayTool : NSObject

@property(nonatomic,strong)AVPlayer * avPlayer;

@property(nonatomic,strong)NSMutableArray <VoiceListModel *> *voiceDataArray;

@property(nonatomic,assign)int currentId;

@property(nonatomic,assign)NSString * currentTime;

@property(nonatomic,assign)NSString * totalTime;
//@property(nonatomic,strong)UISlider *voiceSlider;
//
//@property(nonatomic,strong)UIProgressView * loadTimeProgress;

@property(nonatomic,assign)float playProgress;

@property(nonatomic,assign)float loadProgress;

@property(nonatomic,strong)VoiceListModel * currentModel;

@property(nonatomic,strong)UIButton * playButton;

//当前歌曲进度监听
@property(nonatomic,strong)id timeObserver;

+(instancetype)shareSoundPlay;

-(void)play;

-(void)pause;

-(void)goOnPlay;

-(void)nextVoiceButtonClick;

-(void)upVoiceButtonClick;

//通过KVO监听播放器状态
-(void)addPlayStatus;

//KVO监听音乐缓冲状态
-(void)addPlayLoadTime;

//移除监听音乐播放进度
-(void)removeTimeObserver;

//移除监听音乐缓冲状态
-(void)removePlayLoadTime;

//移除监听播放器状态
-(void)removePlayStatus;


@end
